package com.zangs.emqx_expand.emqx.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zangs.emqx_expand.common.annotation.Excel;
import com.zangs.emqx_expand.common.core.domain.BaseEntity;

/**
 * MQTT 权限对象 mqtt_acl
 * 
 * @author zangs
 * @since 2025-01-26
 */
@ApiModel(value = "MqttAcl", description = "emqx规则")

public class MqttAcl extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 唯一标识符 */
    @ApiModelProperty("id")
    private Long id;

    /** 操作类型（订阅、发布或全部） */
    @ApiModelProperty("操作类型('subscribe', 'publish', 'all')")

    @Excel(name = "操作类型", readConverterExp = "订=阅、发布或全部")
    private String action;

    /** 用户ID */
    @ApiModelProperty("用户ID")
    @Excel(name = "用户ID")
    private Long userId;

    /** 客户端ID */
    @ApiModelProperty("客户端ID")
    @Excel(name = "客户端ID")
    private String clientId;

    /** 主题 */
    @ApiModelProperty("主题")
    @Excel(name = "主题")
    private String topic;

    /** 主题UID */
    @ApiModelProperty("主题UID")
    @Excel(name = "主题UID")
    private String topicUid;

    /** 权限（1表示允许，0表示拒绝） */
    @ApiModelProperty("权限")
    @Excel(name = "权限", readConverterExp = "1=表示允许，0表示拒绝")
    private Boolean permission;

    /** IP地址 */
    @ApiModelProperty("IP地址")

    @Excel(name = "IP地址")
    private String ipAddress;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }
    public void setAction(String action) 
    {
        this.action = action;
    }

    public String getAction() 
    {
        return action;
    }
    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }
    public void setClientId(String clientId) 
    {
        this.clientId = clientId;
    }

    public String getClientId() 
    {
        return clientId;
    }
    public void setTopic(String topic) 
    {
        this.topic = topic;
    }

    public String getTopic() 
    {
        return topic;
    }
    public void setTopicUid(String topicUid) 
    {
        this.topicUid = topicUid;
    }

    public String getTopicUid() 
    {
        return topicUid;
    }
    public void setPermission(Boolean permission) 
    {
        this.permission = permission;
    }

    public Boolean getPermission() 
    {
        return permission;
    }
    public void setIpAddress(String ipAddress) 
    {
        this.ipAddress = ipAddress;
    }

    public String getIpAddress() 
    {
        return ipAddress;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("action", getAction())
            .append("userId", getUserId())
            .append("clientId", getClientId())
            .append("topic", getTopic())
            .append("topicUid", getTopicUid())
            .append("permission", getPermission())
            .append("ipAddress", getIpAddress())
            .toString();
    }
}
